package org.mullin.stratego.server;

import java.util.ArrayList;
import java.util.List;

import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;

@Entity
public class Match {
	
	@Id long matchId;
	
	String serializedState;
	String redPlayer;
	String bluePlayer;
	String winner;
	boolean inPlay;
	
	List<String> moves = new ArrayList<String>();
	
	@SuppressWarnings("unused")
	private Match() { }
	
	public Match(String redPlayer, String bluePlayer, long matchId) {
		this.matchId = matchId;
		this.redPlayer = redPlayer;
		this.bluePlayer = bluePlayer;
		this.inPlay = true;
	}
	
	public void addMove(String m) {
		moves.add(m);
	}
	
	public String getRedPlayer() {
		return redPlayer;
	}
	
	public String getBluePlayer() {
		return bluePlayer;
	}
	
	public String getSerializedState() {
		return serializedState;
	}
	
	public long getMatchId() {
		return matchId;
	}
}
